From: Andrew Cooper Date: Tue, 20 Jun 2017 09:40:56 +0000 (+0100) Subject: common/gnttab: gnttab_query_size() cleanup X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1687 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=f0cd93c2a85562b66e86c78c49335c14613c9e76;p=xen.git common/gnttab: gnttab_query_size() cleanup Drop pointless debugging messages, and reduce variable scope. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index b97d2b9013..49a18e8084 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -1713,30 +1713,24 @@ gnttab_query_size( { struct gnttab_query_size op; struct domain *d; - int rc; if ( count != 1 ) return -EINVAL; - if ( unlikely(copy_from_guest(&op, uop, 1) != 0) ) - { - gdprintk(XENLOG_INFO, "Fault while reading gnttab_query_size_t.\n"); + if ( unlikely(copy_from_guest(&op, uop, 1)) ) return -EFAULT; - } d = rcu_lock_domain_by_any_id(op.dom); if ( d == NULL ) { - gdprintk(XENLOG_INFO, "Bad domid %d.\n", op.dom); op.status = GNTST_bad_domain; - goto query_out; + goto out; } - rc = xsm_grant_query_size(XSM_TARGET, current->domain, d); - if ( rc ) + if ( xsm_grant_query_size(XSM_TARGET, current->domain, d) ) { op.status = GNTST_permission_denied; - goto query_out_unlock; + goto out; } grant_read_lock(d->grant_table); @@ -1747,11 +1741,10 @@ gnttab_query_size( grant_read_unlock(d->grant_table); + out: + if ( d ) + rcu_unlock_domain(d); - query_out_unlock: - rcu_unlock_domain(d); - - query_out: if ( unlikely(__copy_to_guest(uop, &op, 1)) ) return -EFAULT;